﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Wix.Aura.Common;
using Wix.Aura.UnitTests.Tools;

namespace Wix.Aura.UnitTests.Common {
	[TestFixture]
	public class PermissionExSerialization {
		[SetUp]
		public void SetUp() {
			ex = new PermissionEx("sddl");
		}

		PermissionEx ex;

		[Test]
		public void EmptyPermissionEx() {
			XmlAssert.AreEqual(@"<PermissionEx Sddl=""sddl"" />", ex);
		}

		[Test]
		public void AllAttributes() {
			ex.Condition = new ComponentCondition("if");
			ex.Id = "Permission1";
			XmlAssert.AreEqual(@"<PermissionEx Id=""Permission1"" Sddl=""sddl""><Condition>if</Condition></PermissionEx>", ex);
		}
	}
}
